
#include <vector>
#include <string>
#include "Functions.h"
#include "VariableDict.h"

void VariableDict::setValue(const std::string &variableName, int variableValue) {
  variableMap[variableName] = variableValue;      
}

bool VariableDict::existValue(const std::string &variableName) {
  StrIntMap::iterator it = variableMap.find(variableName);
  return (it != variableMap.end());
}

int VariableDict::getValue(const std::string &variableName) {
  StrIntMap::iterator it = variableMap.find(variableName);
  if (it != variableMap.end()) {
    return variableMap[variableName];
  }    
  throw std::logic_error("unknown variable");    
}

VariableDict::~VariableDict() {
}
